﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusinessObjects {

  /// <summary>
  /// Trustperson object
  /// </summary>
  public class TrustPerson : Person {

    private bool useChildLink;
    private int childId;

    #region - Properties -

    /// <summary>
    /// Gets or sets a value indicating whether [use child link].
    /// </summary>
    /// <value>
    ///   <c>true</c> if [use child link]; otherwise, <c>false</c>.
    /// </value>
    public bool UseChildLink {
      get { return useChildLink; }
      set {
        SetField( ref useChildLink, value, "UseChildLink" );
      }
    }

    /// <summary>
    /// Gets or sets the child id.
    /// </summary>
    /// <value>
    /// The child id.
    /// </value>
    public int ChildId {
      get { return childId; }
      set { childId = value; }
    }

    #endregion

    #region - Constructor -

    /// <summary>
    /// Initializes a new instance of the <see cref="TrustPerson"/> class.
    /// </summary>
    public TrustPerson( ) {
      this.Address = new Address( );
    }

    #endregion

    /// <summary>
    /// Copies this instance.
    /// </summary>
    /// <returns></returns>
    public TrustPerson Copy( ) {
      TrustPerson copyPerson = new TrustPerson( );
      copyPerson.Id = this.Id;
      copyPerson.Name = this.Name;
      copyPerson.FirstName = this.FirstName;
      copyPerson.ChildId = this.ChildId;
      copyPerson.UseChildLink = this.UseChildLink;
      copyPerson.Phone = this.Phone;
      copyPerson.Photo = this.Photo;
      copyPerson.Gsm = this.Gsm;
      copyPerson.Email = this.Email;
      copyPerson.NationalNumber = this.NationalNumber;
      copyPerson.Address.Street = this.Address.Street;
      copyPerson.Address.ZipcodeId = this.Address.ZipcodeId;
      copyPerson.Address.Zipcode = this.Address.Zipcode;
      copyPerson.Address.City = this.Address.City;
      copyPerson.Address.CountryCode = this.Address.CountryCode;
      copyPerson.Address.CountryId = this.Address.CountryId;
      copyPerson.Address.CountryName = this.Address.CountryName;
      copyPerson.Address.HasChanged = this.Address.HasChanged;
      copyPerson.HasChanged = this.HasChanged;
      return copyPerson;
    }


  }
}
